import request from '@/axios'
import { RequestResponse } from './types'
export const PATH_URL = import.meta.env.VITE_APP_SERVER
// 查询无人机列表(分页)
export const getDronePage = (params) => {
  return request.get<IResponse<RequestResponse>>({
    url: PATH_URL+'/drone/index',
    params
  })
}

// 添加无人机
export const droneAdd = (data) => {
  return request.post<IResponse<RequestResponse>>({
    url: PATH_URL+'/drone/add',
    data
  })
}

// 编辑无人机
export const droneEdit = (data) => {
  return request.put<IResponse<RequestResponse>>({
    url:PATH_URL+ '/drone/edit',
    data
  })
}

// 删除无人机
export const droneDelete = (params) => {
  return request.delete<IResponse<RequestResponse>>({
    url:PATH_URL+ '/drone/delete',
    params
  })
}

// 获取无人机列表
export const getDroneList = (params) => {
  return request.get<IResponse<RequestResponse>>({
    url: PATH_URL+'/drone/getDroneList',
    params
  })
}

// 查询无人机详情
export const droneDetail = (params) => {
  return request.get<IResponse<RequestResponse>>({
    url: PATH_URL+'/drone/detail',
    params
  })
}

// 资源管理-挂载

// 获取挂载设备列表分页
export const getMountList = (params) => {
  return request.get<IResponse<RequestResponse>>({
    url: PATH_URL+'/mount/index',
    params
  })
}


// 添加挂载设备
export const mountAdd = (data) => {
  return request.post<IResponse<RequestResponse>>({
    url: PATH_URL+'/mount/add',
    data
  })
}

// 编辑挂载设备
export const mountEdit= (data) => {
  return request.put<IResponse<RequestResponse>>({
    url: PATH_URL+'/mount/edit',
    data
  })
}

// 删除挂载设备
export const mountDelete= (params) => {
  return request.delete<IResponse<RequestResponse>>({
    url: PATH_URL+'/mount/delete',
    params
  })
}

// 获取挂载设备列表-不分页
export const mountEquipmentList= (params) => {
  return request.get<IResponse<RequestResponse>>({
    url: PATH_URL+'/mount/mountEquipmentList',
    params
  })
}
// 获取挂载设备  根据id查询详情
export const mountFindDeail= (params) => {
  return request.get<IResponse<RequestResponse>>({
    url: PATH_URL+'/mount/findDeail',
    params
  })
}



// 查询机场列表(分页)
export const airportList= (params) => {
  return request.get<IResponse<RequestResponse>>({
    url: PATH_URL+'/airport/index',
    params
  })
}

// 添加机场
export const airportAdd= (data) => {
  return request.post<IResponse<RequestResponse>>({
    url: PATH_URL+'/airport/add',
    data
  })
}

// 编辑机场
export const airportEdit= (data) => {
  return request.put<IResponse<RequestResponse>>({
    url: PATH_URL+'/airport/edit',
    data
  })
}

// 删除机场
export const airportDelete= (params) => {
  return request.delete<IResponse<RequestResponse>>({
    url: PATH_URL+'/airport/delete',
    params
  })
}

// 查询机巢详情
export const airportFindDeail= (params) => {
  return request.get<IResponse<RequestResponse>>({
    url: PATH_URL+'/airport/detail',
    params
  })
}

// 获取航线文件列表(分页)
export const routeList= () => {
  return request.get<IResponse<RequestResponse>>({
    url: PATH_URL+'/airportScreen/queryFlightCountInfo?tenantId=65',
  })
}

// 添加航线文件
export const routeAdd= (data) => {
  return request.post<IResponse<RequestResponse>>({
    url: PATH_URL+'/route/add',
    data
  })
}

// 编辑航线文件
export const routeEdit= (data) => {
  return request.put<IResponse<RequestResponse>>({
    url: PATH_URL+'/route/edit',
    data
  })
}

// 删除航线文件
export const routeDelete= (params) => {
  return request.delete<IResponse<RequestResponse>>({
    url: PATH_URL+'/route/delete',
    params
  })
}

// 获取航线文件列表
export const AirlineFileList= (params) => {
  return request.get<IResponse<RequestResponse>>({
    url: PATH_URL+'/route/getAirlineFileList',
    params
  })
}

// 根据机场id获取航线文件列表
export const airlineFileListByAirportId= (params) => {
  return request.get<IResponse<RequestResponse>>({
    url: PATH_URL+'/route/getAirlineFileListByAirportId',
    params
  })
}




